package com.spica.platform.base.exception.instance;

import com.spica.platform.base.exception.errorcode.IErrorCode;

public abstract class AbstractBaseException extends RuntimeException{
    private IErrorCode errorCode;

    private transient Object[] params;

    public AbstractBaseException(IErrorCode errorCode) {
        super(errorCode.getRtnMessage());
        this.errorCode = errorCode;
    }

    public AbstractBaseException(IErrorCode errorCode, Object... params) {
        super(errorCode.getRtnMessage());
        this.errorCode = errorCode;
        this.params = params;
    }

    public AbstractBaseException(IErrorCode errorCode, Throwable cause) {
        super(errorCode.getRtnMessage(), cause);
        this.errorCode = errorCode;
    }

    public AbstractBaseException(IErrorCode errorCode, Throwable cause, Object... params) {
        super(errorCode.getRtnMessage(params), cause);
        this.errorCode = errorCode;
        this.params = params;
    }

    public AbstractBaseException(String errCod, String errMsg) {

    }
}
